/*
 * MemBuff.h
 *
 *  Created on: Feb 8, 2013
 *      Author: ozma
 */

#ifndef MEMBUFF_H_
#define MEMBUFF_H_

#include <string>

class MemBuff {
private:
	void init(const char* buf, int size);
	void deleteInternals();

public:
	MemBuff();
	MemBuff(const MemBuff & other);
	MemBuff(const char* buf, int size);
	MemBuff(std::string str);

	virtual ~MemBuff();

	MemBuff & operator=(const MemBuff & other);
	bool operator==(const MemBuff & other);

	/* don't hold pointer to this buff. only use it directly from this container */
	char* buf;
	int size;
};

std::string string_format(const std::string &fmt, ...);

#endif /* MEMBUFF_H_ */



